CXX = g++
CXXFLAGS = -std=c++14 -Wconversion -Wall -I ~/build/release-install-cpp11/include
CXXDLAGS = -L ~/build/release-install-cpp11/lib/ -lmuduo_net -lmuduo_base -lpthread -lrt

SOURCES    = $(wildcard *.cc)
OBJECTS    = main.o tunnel.o socks4a.o  
EXECUTABLE =  socks4a
INCLUDE    = -I ~/build/release-install-cpp11/include
release: CXXFLAGS += -O3 -DNDEBUG
release: $(EXECUTABLE)      

debug: CXXFLAGS += -g3 -DDEBUG
debug:  
	$(CXX) $(INCLUDE) $(CXXFLAGS) $(OBJECTS)  $(CXXDLAGS) -o $(EXECUTABLE)_debug

all: release debug
$(EXECUTABLE): $(OBJECTS)
ifeq ($(EXECUTABLE), executable)
	@echo Edit EXECUTABLE variable in Makefile.
	@echo Using default a.out.
	$(CXX) $(INCLUDE) $(CXXFLAGS) $(OBJECTS)  $(CXXDLAGS) 
else
	$(CXX) $(INCLUDE) $(CXXFLAGS) $(OBJECTS)  $(CXXDLAGS) -o $(EXECUTABLE) 
endif
	
.PHONY : clean 
clean : 
	-rm -f $(OBJECTS) $(EXECUTABLE)
